home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
array2.h
< prev
next >
Wrap
Text File
|
1996-02-04
|
1KB
|
64 lines
/*
*
* Copyright (c) 1993-1996 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37067
*
* ALL RIGHTS RESERVED.
*
*
*
*/
/* The next three lines are used to define the type used for indexing */
#define INDEX_TYPE unsigned
#if defined(unix) || defined(M_I386)
#define AT_INDEX AT_LONG
#define PRNT_SHAPE "%u "
#else
#define AT_INDEX AT_USHT
#define PRNT_SHAPE "%hu "
#endif
#define BITS_PER_BYTE 8
#define BIT_VAL(x,y) (((char *) (x))[(INDEX_TYPE) (y) / (INDEX_TYPE) BITS_PER_BYTE] & pow1[(INDEX_TYPE) (y) % (INDEX_TYPE) BITS_PER_BYTE])
#define SET_BIT(p,off,val) if (val) \
((char *) (p))[off / BITS_PER_BYTE] |= pow1[off % BITS_PER_BYTE]; \
else \
((char *) (p))[off / BITS_PER_BYTE] &= pow2[off % BITS_PER_BYTE]
/* Returns the size of the data portion of an array */
#define SIZE(type,n) (type != AT_BIT ? (INDEX_TYPE) _A_esize(type) * n \
: (n ? (n+(BITS_PER_BYTE-1)) / BITS_PER_BYTE : 0L))
typedef unsigned short _ushort;
/*
*
* Copyright (c) 1993-1996 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37067
*
* ALL RIGHTS RESERVED.
*
*
*
*/